package com.lry.provider.filter;

import javax.ws.rs.container.ContainerRequestContext;
import javax.ws.rs.container.ContainerResponseContext;
import javax.ws.rs.container.ContainerResponseFilter;
//如果不是http来请求dubbo，而是dubbo消费端使用ClientResponseFilter:
//提供方使用ContainerResponseFilter
public class CacheControlFilter implements ContainerResponseFilter {
    //我们响应出去进这里
    public void filter(ContainerRequestContext req, ContainerResponseContext res) {
        if (req.getMethod().equals("GET")) {
            res.getHeaders().add("Cache-Control", "someValue");
        }
    }
}
